{extend name="default/base/base_seller" /}
{block name="seller_main"}

<style>
    .search-form th {
        width: 80px;
    }
</style>

<form method="get" action="">
    <input type="hidden" name="lock" value="{$Request.param.lock}" />
    <table class="search-form">
        <tr>
            <!-- <td style="width: 1px;"></td>
            <td>&nbsp;</td><th>{$Think.lang.return_order_add_time}</th>
            <td class="w240">
                <input type="text" class="text w70" name="add_time_from" id="add_time_from" value="{$Request.param.add_time_from}" />
                <label class="add-on"><i class="iconfont">&#xe8d6;</i></label>&nbsp;&#8211;&nbsp;
                <input id="add_time_to" type="text" class="text w70"  name="add_time_to" value="{$Request.param.add_time_to}" />
                <label class="add-on"><i class="iconfont">&#xe8d6;</i></label>
            </td> -->
            <td>订单编号</td>
            <td style="width: 180px;"><input type="text" class="text" name="order_sn" value="{$Request.get.order_sn}" /></td>

            <th class="w60">订单状态</th>
            <td class="w80">
                <select name="order_state" class="querySelect">
                    <option value="">{$Think.lang.ds_please_choose}</option>
                    <option value="0" {if condition="$Request.param.order_state eq '0'"}selected{/if}>已作废</option>
                    <option value="1" {if condition="$Request.param.order_state eq '1'"}selected{/if}>待审核</option>
                    <option value="6" {if condition="$Request.param.order_state eq '6'"}selected{/if}>审核未通过</option>
                    <option value="2" {if condition="$Request.param.order_state eq '2'"}selected{/if}>待支付</option>
                    <option value="3" {if condition="$Request.param.order_state eq '3'"}selected{/if}>支付完成待派单</option>
                    <option value="9" {if condition="$Request.param.order_state eq '9'"}selected{/if}>派单中</option>
                    <option value="7" {if condition="$Request.param.order_state eq '7'"}selected{/if}>疑问单</option>
                    <option value="8" {if condition="$Request.param.order_state eq '8'"}selected{/if}>已接单</option>
                    <option value="4" {if condition="$Request.param.order_state eq '4'"}selected{/if}>已完成</option>
                    <option value="5" {if condition="$Request.param.order_state eq '5'"}selected{/if}>已退款</option>
                    <option value="5" {if condition="$Request.param.order_state eq '10'"}selected{/if}>大客户已审核</option>
                    <option value="5" {if condition="$Request.param.order_state eq '11'"}selected{/if}>大客户待审核</option>
                    <option value="5" {if condition="$Request.param.order_state eq '12'"}selected{/if}>大客户审核失败</option>
                </select>
            </td>

            <th>订单类型</th>
            <td class="w80">
                <select name="order_type" class="querySelect">
                    <option value="">{$Think.lang.ds_please_choose}</option>
                    <option value="1" {if condition="$Request.param.order_type eq '1'"}selected{/if}>安装</option>
                    <option value="2" {if condition="$Request.param.order_type eq '2'"}selected{/if}>维修</option>
                    <option value="3" {if condition="$Request.param.order_type eq '3'"}selected{/if}>移机</option>
                    <option value="4" {if condition="$Request.param.order_type eq '4'"}selected{/if}>保养</option>

                </select>
            </td>



            <th class="w60">买家账号</th>
            <td class="w80">
                <input type="text" class="text" name="buyer_name" value="{$Request.get.buyer_name}" />
            </td>
            <td>

            </td>
        </tr>
        <tr>
            <th style="">下单时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
            <td style="width: 150px !important;">
                <input type="text" class="txt date" style="width: 65px;" name="query_start_time" id="query_start_time" value="{$Request.param.query_start_time}">
                -
                <input id="query_end_time" class="txt date" style="width: 65px;" type="text" name="query_end_time" value="{$Request.param.query_end_time}" >
            </td>
            <td style="margin: 0;padding: 0; width: 10px;text-align: center"></td>
            <td>

            </td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td class="w70 " style="width: 760px !important;">
                <input type="submit" class="submit" value="{$Think.lang.ds_search}" style="display: inline-block;" />
                <a href="{:url('order_da/index')}" class="dssc-btn dssc-btn-acidblue ml5 mr5">
                    <p style="display: inline-block;">取消</p>
                </a>
            </td>

        </tr>
    </table>
</form>
<table class="dssc-default-table">
    <thead>
    <tr ds_type="table_header">
        <th class="w100">订单编号</th>
        <th class="w180">订单类型</th>
        <!-- <th class="w180">退款数量</th> -->
        <th class="w180">买家账号</th>
        <th class="w180">订单总额</th>
        <th class="w180">订单状态</th>
        <th class="w180">下单时间</th>

        <th class="w150">{$Think.lang.ds_handle}</th>
    </tr>
    </thead>
    <tbody>
    {notempty name="return_list"}
    {foreach name="return_list" item="val" }

    <tr>
        <td>{$val.order_sn}</td>
        <td>
            {$order_type[$val.order_type]}
        </td>
        <!-- <td>{$Think.lang.currency}{$val.refund_amount}</td> -->
        <td>{$val.member_name}</td>

        <td>{$val.order_amount}</td>
        <td>{$order_state[$val['order_state']]}</td>
        <td>{$val.add_time|date="Y-m-d H:i:s",###}</td>

        <td class="dscs-table-handle">
            <!-- 查看详情 -->
            <span> <a href="{:url('OrderDa/show',['order_id'=>$val.order_id])}" class="btn-orange"><i class="iconfont">&#xe70b;</i><p>{$Think.lang.ds_view}</p></a></span>
            {if $val.order_state == 11}
            <!-- 审核 -->
            <span><a href="javascript:void(0)" order-id="{$val.order_id}"  class="btn-blue shenhe"><i class="iconfont">&#xe731;</i><p>通过审核</p></a></span>
            <span><a href="javascript:void(0)" order-id="{$val.order_id}"  class="btn-blue shenheno"><i class="iconfont">&#xe731;</i><p>不通过审核</p></a></span>
            {else /}

            {/if}

        </td>
    </tr>
    <tr style="display:none;">
        <td colspan="7"><div class="dssc-goods-sku ps-container"></div></td>
    </tr>
    {/foreach}
    {else /}
    <tr>
        <td colspan="7" class="norecord"><div class="warning-option"><i class="iconfont">&#xe64c;</i><span>{$Think.lang.no_record}</span></div></td>
    </tr>
    {/notempty}
    </tbody>
        <tfoot>
        {notempty name="return_list"}
        <tr>
            <td colspan="20"><div class="pagination">{$show_page}</div></td>
        </tr>
        {/notempty}
    </tfoot>
</table>

<script>
    $(function () {
        $('#add_time_from').datepicker({dateFormat: 'yy-mm-dd'});
        $('#add_time_to').datepicker({dateFormat: 'yy-mm-dd'});
    });
     $('.shenhe').click(function () {
        //询问框
        var id = $(this).attr('order-id')

         var iid = layer.confirm('确认通过审核吗', {
            btn: ['通过','取消'] //按钮
        }, function(){
            $.get("{:url('OrderDa/edit')}", {
                order_id: id,
                state: 10,
            }, function (res) {


                layer.msg(res.message, {icon: 1, time: 1000}, function () {
                    window.location.reload()
                });

            }, 'json')

        }, function(){
            layer.closeAll();
        });
    })

    $('.shenheno').click(function () {
        //询问框
        var id = $(this).attr('order-id')

        var iiid = layer.confirm('确认不通过审核吗？', {
            btn: ['确认','取消'] //按钮
        }, function(){
            layer.close(iiid)
            layer.prompt({
                formType:2,
                title: '不通过原因'
            },function(val, index){

                $.get("{:url('OrderDa/other')}", {
                    order_id: id,
                    other: val
                }, function (res) {
                    $.get("{:url('OrderDa/edit')}", {
                        order_id: id,
                        state: 12,
                    }, function (res) {
                        layer.close(index);
                        layer.msg(res.message, {icon: 1, time: 1000}, function () {
                            window.location.reload()
                        });

                    }, 'json')
                }, 'json')

            });
        }, function(){
            layer.closeAll();
        });
    })
    $((function($){

            $.datepicker.regional['zh-CN'] = {

                clearText: '清除',

                clearStatus: '清除已选日期',

                closeText: '关闭',

                closeStatus: '不改变当前选择',

                prevText: '<上月',

                prevStatus: '显示上月',

                prevBigText: '<<',

                prevBigStatus: '显示上一年',

                nextText: '下月>',

                nextStatus: '显示下月',

                nextBigText: '>>',

                nextBigStatus: '显示下一年',

                currentText: '今天',

                currentStatus: '显示本月',

                monthNames: ['一月','二月','三月','四月','五月','六月', '七月','八月','九月','十月','十一月','十二月'],

                monthNamesShort: ['一','二','三','四','五','六', '七','八','九','十','十一','十二'],

                monthStatus: '选择月份',

                yearStatus: '选择年份',

                weekHeader: '周',

                weekStatus: '年内周次',

                dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],

                dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],

                dayNamesMin: ['日','一','二','三','四','五','六'],

                dayStatus: '设置 DD 为一周起始',

                dateStatus: '选择 m月 d日, DD',

                dateFormat: 'yy-mm-dd',

                firstDay: 1,

                initStatus: '请选择日期',

                showMonthAfterYear:true,//是否把月放在年的后面

                yearSuffix: '年', //年的后缀

                isRTL: false

                  };

            $.datepicker.setDefaults($.datepicker.regional['zh-CN']);

        })(jQuery));
</script>
<script type="text/javascript">
    $(function(){
        $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
        $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
    });
</script>


{/block}
